home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Macintosh Demo Applications CD
/
Apple-MacintoshDemoApplicationsCD-1.0-1992.bin
/
More Information
/
Personal Press 2.0
/
PPPouch
/
Additions
/
Text Commands
/
Pull Quote…
/
Pull Quote…
next >
Wrap
Text File
|
1992-06-08
|
4KB
|
169 lines
on startup
global pullQuoteTop, pullQuoteWidth, pullQuoteBottom, theQuote ,columnWidth
global bailout
checkTextToolIsOn
if bailout <> "true" then
put 0 into pullQuoteTop
put 0 into pullQuoteWidth
put 0 into pullQuoteBottom
put " " into theQuote
put currentstoryNumber() into storyNum
--pullQuoteDialog
set lockscreen to true
put char (item 1 of textcursor) to (item 2 of textcursor) ¬
of story storyNum into theQuote
put char number(chars in theQuote)-1 of theQuote into theLastChar
if theLastChar = cr then
put " " into char number(chars in theQuote)-1 of story theQuote
end if
calcBounds
createPullQuoteStory
createPullQuoteFrame
end if -- end of bailout
end startup
on checkTextToolIsOn
global bailout
put "true" into bailout
if toolmode <> "textTool" then
answer "The TextTool must be on and text selected."
else if item 2 of textcursor = 0 then
answer "The text to be quoted must be selected."
else if number of columns = 0 then
answer "Number of columns in Publication Setup is set to 0. Set it to " & ¬
"a number greater than zero."
else
put "false" into bailout
end if
end checkTextToolIsOn
on createPullQuoteFrame
global pullQuoteTop, pullQuoteWidth, pullQuoteBottom, theQuote ,columnWidth
choose maintool
select last object
align objects to margins center none
select last object
set fillPattern to 17
set framelinetype to 12
set linepattern to 1
minimizeTextObjectSize
end createPullQuoteFrame
on createPullQuoteStory
global pullQuoteTop, pullQuoteWidth, pullQuoteBottom, theQuote ,columnWidth
choose maintool
open story "PullQuote"
draw rectangle from leftmargin,pullQuoteTop ¬
to leftmargin + columnWidth,pullQuoteBottom
close story
select objects number(objects)
choose texttool
put "“ ”" into story "PullQuote"
put theQuote into char 2 of story "PullQuote"
select all text
set textSize to 18
set textface to italic
set rulerJustification to center
select text char 1 to 1 of story "PullQuote"
set textSize to 24
set textFace to bold
set findString to "”"
put find() into numFound
set textSize to 24
set textFace to bold
end createPullQuoteStory
on calcBounds
global pullQuoteTop, pullQuoteWidth, pullQuoteBottom, theQuote ,columnWidth
put number(columns) into numColumns
put pageWidth - rightMargin - leftmargin into availableWidth
put (availableWidth - (columnSpacing *(number(columns)-1))) / ¬
number(columns) into columnWidth
put pageHeight - topMargin - bottomMargin into availableHeight
put availableheight /2 into pullQuoteCenter
put 3 into pullQuoteHeight
put pullQuoteCenter - (pullQuoteHeight /2) into pullQuoteTop
put pullQuoteTop + pullQuoteHeight into pullQuoteBottom
end calcBounds
on pullQuoteDialog
put dialog(preload,10500) into thedialog
put "uvda\0" into item8
-- put "uvda\0" into item9
put "uvdp\1" into item6
put "cve-\1,1,100" into item7
put 5 into numItems
put 1 into baseID
put 100 / (numItems -1) into theIncrement
repeat forever
get dialog(display, thedialog)
switch it
case 1
case 2
exit repeat
exit switch
case 7
put round(item 2 of item7 / theIncrement) + baseID into thePicID
put "---p\"& thepicid into item6
put (thepicid - baseID) * theIncrement into item 2 of item7
put round(item 2 of item7 / theIncrement) * theIncrement into item 2 of item7
exit switch
end switch
end repeat
put it into results
get dialog(dispose, thedialog)
end pullQuoteDialog
on help
put dialog (preload, 128) into thedialog
put "---a\0" into item2
put "---a\1" into item3
put "---a\2" into item4
repeat forever
get dialog(display, thedialog)
if (it = 1) then exit repeat
end repeat
get dialog(dispose, thedialog)
end help